import { request } from '../utils/request';
import type { ApiResponse } from '../types/common';
import type {
  IndustryReportItem,
  IndustryReportDetail,
  IndustryReportParams,
} from '../types/industry-report';

export const industryReportApi = {
  // 获取产业报告列表
  getIndustryReportList: (params: IndustryReportParams) =>
    request.get<any, ApiResponse<{ count: number; results: IndustryReportItem[] }>>('/industry/', {
      params,
    }),

  // 获取产业报告详情
  getIndustryReportDetail: (reportId: string) =>
    request.get<any, ApiResponse<IndustryReportDetail>>(`/industry/${reportId}/`),

  // 生成产业报告
  generateIndustryReport: (data: { keyword: string }) =>
    request.post<any, ApiResponse<any>>('/industry/generate/', data),

  // 删除产业报告
  deleteIndustryReport: (reportId: string) =>
    request.delete<any, ApiResponse<null>>(`/industry/${reportId}/`)
};